


set -l prog hdfs

set -l subcmds 'dfs namenode dfsadmin groups'

complete -c $prog -f



lyt-defcmd-root $prog $subcmds

complete -c $prog -s D -d "Define properties work in this command"

## hdfs dfs ########################################
set -l subcmds '-mkdir -ls -rm -rmdir -copyFromLocal -moveFromLocal -get -put'

lyt-defcmd $prog dfs $subcmds
lyt-defcmd-1 $prog dfs $subcmds -mkdir 'create directory'

lyt-defcmd-1 $prog dfs $subcmds -put 'ARGS: <lcl_src>... <dst_path>'



## dfs -mkdir ########################################## 
set -l subcmds '-p'

lyt-defcmd $prog -mkdir $subcmds
lyt-defcmd-1 $prog $subcmds -mkdir -p 'create directory by cascaded heriachy'




## hdfs namenode ########################################
set -l subcmds '-format'

lyt-defcmd $prog namenode $subcmds
lyt-defcmd-1 $prog namenode -format 'initizalize namenode'




## hdfs dfsadmin ########################################
set -l subcmds '-refreshUserToGroupsMappings'

lyt-defcmd $prog dfsadmin $subcmds
lyt-defcmd-1 $prog dfsadmin -refreshUserToGroupsMappings 'refresh auths, should be exec in namenode'
